#ifndef SYS_H
#define SYS_H

#include<iostream>
#include<fstream>
#include<sstream>
#include<vector>
#include<algorithm>
#include "real.h"
using namespace std;

#define _errorstatement1_ cout<<"error: illegal input\n"
#define _errorstatement2_ cout<<"error: illegal input file\n"

struct c_d_rc {
	int t1;											// type 1
	int t2;											// type 2
	real ccc;
	real ddd;
	real rc;
};


class sys  {
public:
	string cname;
	int n_bool;
	int n_int;
	int n_real;
	vector<bool> bps;
	vector<int> ips;
	vector<real> rps;
	vector<string> bps_name;						// bool parameter name list
	vector<string> ips_name;						// integer parameter name list
	vector<string> rps_name;						// real parameter name list
	vector<c_d_rc> pint;							// pair interaction type list
	bool if_c_d_rc;									// if such pair is useful
	int namelength;									// format control number
	char* headerfile;								// default header file name
	char* defaultfile;								// default parameter file name
	
	sys();											// constructor from parameter header file
	sys(char* file);
	void creat(char* file);							// creat parameters and store them in a file
	void creat();
	void write(char* file);							// write parameters to a destination file
	void write();
	void display();									// display parameters on the screen
	void read(char* file);							// read from file, if not exist, creat it
	void read();
	void initialize();
	void initialize(char* file);					// read from header file to initialize parameter
	
private:
	void output(ostream& write);					// implementation of the output of parameters
};


#endif